package com.zw.design.pattern.creational.singleton.v3;

/****
 * 使用静态内部类方式创建单例
 */
public class StaticInnerClassSingleton {

    private static  class InnerClass{
        private final static  StaticInnerClassSingleton singleton=new StaticInnerClassSingleton();
    }
    public static StaticInnerClassSingleton getInstance(){
        return InnerClass.singleton;
    }

    private StaticInnerClassSingleton(){

    }
}
